home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / git-4.3 / git-4 / git-4.3.11 / src / tty.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  4.1 KB  |  141 lines

  1. /* tty.h -- Data structures & function prototypes for tty.c stuff.  */
  2.  
  3. /* Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
  4.  
  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 2, or (at your option)
  8.    any later version.
  9.  
  10.    This program is distributed in the hope that it will be useful,
  11.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.    GNU General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU General Public License
  16.    along with this program; if not, write to the Free Software
  17.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. /* Written by Tudor Hulubei and Andrei Pitis.  */
  20.  
  21.  
  22. #ifndef _GIT_TTY_H
  23. #define _GIT_TTY_H
  24.  
  25.  
  26. #include <sys/types.h>
  27.  
  28. #ifdef HAVE_POSIX_TTY
  29. #include <termios.h>
  30. #else
  31. #ifdef HAVE_SYSTEMV_TTY
  32. #include <termio.h>
  33. #else
  34. #include <sgtty.h>
  35. #endif /* HAVE_SYSTEMV_TTY */
  36. #endif /* HAVE_POSIX_TTY */
  37.  
  38. #include "window.h"
  39.  
  40.  
  41. #define OFF                     0
  42. #define ON                      1
  43.  
  44.  
  45. /* Color constants.  */
  46. #define BLACK                   0
  47. #define RED                     1
  48. #define GREEN                   2
  49. #define YELLOW                  3
  50. #define BLUE                    4
  51. #define MAGENTA                 5
  52. #define CYAN                    6
  53. #define WHITE                   7
  54.  
  55.  
  56. /* Some key aliases.  */
  57. #define key_CTRL_G              0007            /* Ctrl-G               */
  58. #define key_CTRL_Z              0032            /* Ctrl-Z               */
  59. #define key_ENTER               0012            /* Enter                */
  60. #define key_BACKSPACE           0177            /* Backspace            */
  61. #define key_TAB                 0011            /* Tab                  */
  62.  
  63.  
  64. /* The interrupt character.  */
  65. #define key_INTERRUPT           key_CTRL_G
  66. #define key_SUSPEND             key_CTRL_Z
  67.  
  68.  
  69. /* Terminal modes.  */
  70. #define TTY_CANONIC     0
  71. #define TTY_NONCANONIC  1
  72.  
  73.  
  74. /* Terminal input modes.  */
  75. #define TTY_RESTRICTED_INPUT    0
  76. #define TTY_FULL_INPUT          1
  77.  
  78.  
  79. #define is_print(c)             ((c) >= ' ' && (c) <= '~')
  80.  
  81.  
  82. extern void (* tty_enter_idle_hook) PROTO (());
  83. extern void (* tty_exit_idle_hook) PROTO (());
  84.  
  85.  
  86. typedef struct tag_tty_key_t
  87. {
  88.     unsigned char *key_seq;
  89.     struct tag_tty_key_t *next;
  90.     void *aux_data;
  91. } tty_key_t;
  92.  
  93.  
  94. typedef unsigned char tty_status_t;
  95.  
  96.  
  97. extern void tty_startup            PROTO ((int));
  98. extern void tty_exit            PROTO ((char *));
  99.  
  100. extern void tty_get_capabilities    PROTO (());
  101. extern void tty_kbdinit            PROTO ((int));
  102. extern void tty_set_mode        PROTO ((int));
  103. extern void tty_set_interrupt_char    PROTO ((unsigned char));
  104.  
  105. extern void  tty_clear            PROTO (());
  106. extern void  tty_fill            PROTO (());
  107. extern void  tty_touch            PROTO (());
  108. extern void  tty_goto            PROTO ((int, int));
  109. extern void  tty_brightness        PROTO ((int));
  110. extern void  tty_foreground        PROTO ((int));
  111. extern void  tty_background        PROTO ((int));
  112. extern void  tty_colors            PROTO ((int, int, int));
  113. extern void  tty_cursor            PROTO ((int));
  114. extern void  tty_beep            PROTO (());
  115. extern void  tty_defaults        PROTO (());
  116. extern void  tty_save            PROTO ((tty_status_t *));
  117. extern void  tty_restore        PROTO ((tty_status_t *));
  118. extern int   tty_putc            PROTO ((unsigned char));
  119. extern int   tty_puts            PROTO ((char *, size_t));
  120. extern int   tty_getc            PROTO (());
  121. extern void  tty_flush            PROTO (());
  122. extern void  tty_update            PROTO (());
  123. extern void  tty_get_size        PROTO ((int *, int *));
  124. extern void  tty_get_screen        PROTO ((char *));
  125. extern void  tty_put_screen        PROTO ((char *));
  126. extern int   tty_get_color_index    PROTO ((char *));
  127. extern void  tty_key_list_insert    PROTO ((unsigned char *, void *));
  128. extern void  tty_key_search_restart    PROTO (());
  129. extern char *tty_key_convert        PROTO ((unsigned char *));
  130. extern char *tty_get_symbol_key_seq    PROTO ((char *));
  131. extern int   tty_set_optimization_level    PROTO ((int));
  132. /*
  133. extern void tty_key_list_delete        PROTO (());
  134. */
  135.  
  136. extern tty_key_t *tty_key_search    PROTO ((char *));
  137. extern tty_key_t *tty_get_key        PROTO ((int *));
  138.  
  139.  
  140. #endif  /* _GIT_TTY_H */
  141.